<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="viewport" content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">

    <title>供应商基本信息</title>
    <link href="../lib/fonts/material-icons.css?family=Material+Icons" rel="stylesheet">
    <link href="../lib/css/animate.min.css" rel="stylesheet">
    <link href="../lib/css/quasar.mat.rtl.min.css" rel="stylesheet" type="text/css">

    <style type="text/css">
      [v-cloak] { display: none; }
      .bdl-secondary-3 { border-left: 3px solid #26a69a }
    </style>
  </head>
  <body>
    <div id="q-supplierBaseInfoLook" v-cloak>
      <q-card class="bg-white full-width">
        <q-card-main>
          <div class="row justify-start q-pa-sm position-relative" style="border: 2px dotted #e6e6e6">
            <div class="q-px-xs q-py-sm q-mt-sm">
              <img src="../static/img/done.png" alt="" style="width: 90px; height: 90px">
            </div>
            <div style="width: 85%">
              <h6 class="q-ma-md text-primary">
                {{ baseInfoForm.name }} 
                <q-chip 
                  color="positive" 
                  v-if="baseInfoForm.phaseNameShang != null"
                  pointing="left"
                  dense
                  square>{{ baseInfoForm.phaseNameShang }}</q-chip>
                <span v-if="baseInfoForm.phaseNameShang != null" class="text-light q-ml-sm" style="font-size:13px">></span>
                <q-chip 
                  color="positive" 
                  pointing="left"
                  dense
                  square>{{ baseInfoForm.phaseName }}</q-chip>
                <span v-if="baseInfoForm.phaseNameXia != null" class="text-light q-ml-sm" style="font-size:13px">></span>
                <q-chip 
                  color="light" 
                  v-if="baseInfoForm.phaseNameXia != null"
                  pointing="left"
                  dense
                  square>{{ baseInfoForm.phaseNameXia }}</q-chip>
              </h6>
              <p class="q-ml-md row gutter-x-sm">
                <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                  成为{{ baseInfoForm.phaseName }}时间：
                  <span class="text-light">{{ baseInfoForm.submiePhaseIdTime }}</span>
                </span>
                <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                  最近更新时间：
                  <span class="text-light">{{ baseInfoForm.lastUpdateTime }}</span>
                </span>
                <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                  编码：
                  <span class="text-light">{{ baseInfoForm.code }}</span>
                </span>
                <span class="col-lg-4 col-md-6 col-sm-6 col-xs-12 q-mt-sm">
                  注册状态：
                  <q-chip dense color="positive" square>
                    通过
                  </q-chip>
                </span>
              </p>
            </div>
            <div class="absolute" style="top: 25px; right: 25px">
              <q-btn v-if="promotable" color="primary" outline @click="supplierPromoteOne" size="sm">晋级</q-btn>
              <q-btn v-if="promotable2" color="primary" outline @click="supplierPromoteTwo" size="sm">晋级</q-btn>
              <q-btn v-if="promotable3" color="primary" outline @click="supplierPromoteThree" size="sm">晋级审批</q-btn>
              <q-btn v-if="degradable" color="primary" outline @click="supplierDegradeOne" size="sm">降级</q-btn>
              <q-btn v-if="degradable2" color="primary" outline @click="supplierDegradeTwo" size="sm">降级</q-btn>
              <q-btn v-if="degradable3" color="primary" outline @click="supplierDegradeThree" size="sm">降级审批</q-btn>
              <q-btn color="primary" flat @click="window.location.href='supplierManage.html'" size="sm">返回</q-btn>
            </div>
          </div>
          <div class="row justify-between gutter-x-sm">
            <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
              <q-tabs 
                align="left"
                v-model="mainTab" 
                :two-lines="false"
                inverted
                color="primary">
                <q-tab slot="title" name="mainInfo" label="主信息" ></q-tab>

                <q-tab-pane name="mainInfo">
                  <div class="row justify-between">
                    <div>
                      <q-btn v-if="mainReviewable" color="primary" @click="reviewHandler('top')" size="sm">审核</q-btn>
                    </div>
                    <div>
                      审核状态：
                      <q-chip dense color="warning" square v-if="baseInfoForm.mainDataStatus === -1">
                        未提交
                      </q-chip>
                      <q-chip dense color="info" square v-else-if="baseInfoForm.mainDataStatus === 0">
                        未审核（已提交）
                      </q-chip>
                      <q-chip dense color="positive" square v-else-if="baseInfoForm.mainDataStatus === 1">
                        通过
                      </q-chip>
                      <q-chip dense color="negative" square v-else-if="baseInfoForm.mainDataStatus === 2">
                        不通过
                        <q-tooltip>驳回理由：{{ baseInfoForm.mainDataContent }}</q-tooltip>
                      </q-chip>
                      <q-chip dense color="warning" square v-else>
                        获取状态失败
                      </q-chip>
                    </div>
                  </div>
                  <div class="row q-mt-md q-px-md q-my-sm">
                    <span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                      公司名称：
                      <span class="text-light">{{ baseInfoForm.name }}</span>
                    </span>
                    <span class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
                      统一社会信用代码：
                      <span class="text-light">{{ baseInfoForm.taxId }}</span>
                    </span>
                    <span class="col-lg-6 col-md-6 col-sm-6 col-xs-12 q-mt-md">
                      营业执照：
                      <a :href="downloadUrl" target="_blank" style="text-decoration: none;">{{ downloadName }}</a>
                    </span>
                    <span class="col-lg-6 col-md-6 col-sm-6 col-xs-12 q-mt-md">
                      有效时间：
                      <span class="text-light">{{ baseInfoForm.usefulTime }}</span>
                    </span>
                    <span class="col-lg-6 col-md-6 col-sm-6 col-xs-12 q-mt-md">
                      变更文件系统编号：
                      <a :href="downloadUrlx" target="_blank" style="text-decoration: none;">{{ downloadNamex }}</a>
                    </span>
                    <span class="col-lg-6 col-md-6 col-sm-6 col-xs-12 q-mt-md">
                      变更内容：
                      <span class="text-light">{{ baseInfoForm.col23 }}</span>
                    </span>
                  </div>
                </q-tab-pane>
              </q-tabs>
              <q-tabs 
                align="left"
                v-model="choosedTab" 
                :two-lines="false"
                inverted
                color="primary">
                <q-tab slot="title" name="baseInfo" label="基本信息" ></q-tab>
                <!-- <q-tab slot="title" name="qualifications" label="资质信息" ></q-tab> -->
                
                <q-tab-pane name="baseInfo">
                  <div class="row justify-between">
                    <div>
                      <q-btn v-if="baseReviewable" color="primary" size="sm" @click="reviewHandler('base')">审核</q-btn>
                    </div>
                    <div>
                      审核状态：
                      <q-chip dense color="warning" square v-if="baseInfoForm.basicsDataStatus === -1">
                        未提交
                      </q-chip>
                      <q-chip dense color="info" square v-else-if="baseInfoForm.basicsDataStatus === 0">
                        未审核（已提交）
                      </q-chip>
                      <q-chip dense color="positive" square v-else-if="baseInfoForm.basicsDataStatus === 1">
                        通过
                      </q-chip>
                      <q-chip dense color="negative" square v-else-if="baseInfoForm.basicsDataStatus === 2">
                        不通过
                        <q-tooltip>驳回理由：{{ baseInfoForm.basicsDataContent }}</q-tooltip>
                      </q-chip>
                      <q-chip dense color="warning" square v-else>
                        获取状态失败
                      </q-chip>
                    </div>
                  </div>
                  <div class="row gutter-x-sm gutter-y-sm q-mt-sm">
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('企业法人')"
                        v-model="baseInfoForm.legalPerson"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('法人身份证号')"
                        v-model="baseInfoForm.col24"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('企业英文全称')"
                        v-model="baseInfoForm.col26"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('邓白氏编码')"
                        v-model="baseInfoForm.duns"></q-input>
                    </q-field>
                    <q-field 
                      icon="group"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('贸易伙伴')"
                        v-model="baseInfoForm.col25"></q-input>
                    </q-field>
                    <q-field 
                      icon="group"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-select
                        :readonly="readonly"  
                        :float-label="$t('企业性质')"
                        :readonly="readonly"
                        :options="propertyOptions"
                        v-model="baseInfoForm.property"></q-select>
                    </q-field>
                    <q-field 
                      icon="group"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-select
                        :readonly="readonly"  
                        :float-label="$t('企业类别')"
                        :readonly="readonly"
                        :options="vendorClassifyOptions"
                        v-model="baseInfoForm.vendorClassify"></q-select>
                    </q-field>
                    <q-field 
                      icon="code"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-select
                        :readonly="readonly"  
                        :float-label="$t('公司代码')"
                        :options="companyIdOptions"
                        v-model="baseInfoForm.companyId"></q-select>
                    </q-field>
                    <q-field 
                      icon="search"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('企业简称')"
                        v-model="baseInfoForm.shortName"></q-input>
                    </q-field>
                    <q-field 
                      icon="location_on"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-select
                        :readonly="readonly"  
                        :float-label="$t('国家')"
                        filter
                        :options="countryOptions"
                        v-model="baseInfoForm.country"></q-select>
                    </q-field>
                    <q-field 
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-select
                        :readonly="readonly"  
                        :float-label="$t('省份')"
                        filter
                        :options="provinceOptions"
                        v-model="baseInfoForm.province"></q-select>
                    </q-field>
                    <q-field 
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-select
                        :readonly="readonly"  
                        :float-label="$t('城市')"
                        filter
                        :options="cityOptions"
                        v-model="baseInfoForm.city"></q-select>
                    </q-field>
                    <q-field 
                      icon="home"
                      class="col-lg-8 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('地址（街道）')"
                        v-model="baseInfoForm.address"></q-input>
                    </q-field>
                    <q-field 
                      icon="email"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('邮箱')"
                        type="email"
                        v-model="baseInfoForm.email"></q-input>
                    </q-field>
                    <q-field 
                      icon="contact_mail"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('邮编')"
                        type="number"
                        v-model="baseInfoForm.postCode"></q-input>
                    </q-field>
                    <q-field 
                      icon="call"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('电话')"
                        v-model="baseInfoForm.phone"></q-input>
                    </q-field>
                    <q-field 
                      icon="stay_primary_portrait"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('手机')"
                        type="number"
                        v-model="baseInfoForm.mobilePhone"></q-input>
                    </q-field>
                    <q-field 
                      icon="local_printshop"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('传真')"
                        v-model="baseInfoForm.fax"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('联系人')"
                        v-model="baseInfoForm.contacts"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('总经理联系人')"
                        v-model="baseInfoForm.managerContact"></q-input>
                    </q-field>
                    <q-field 
                      icon="call"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('总经理联系电话')"
                        v-model="baseInfoForm.managerTelephone"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('销售总监联系人')"
                        v-model="baseInfoForm.salesDirector"></q-input>
                    </q-field>
                    <q-field 
                      icon="call"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('销售总监联系电话')"
                        v-model="baseInfoForm.salesDirectorTelephone"></q-input>
                    </q-field>
                    <q-field 
                      icon="person"
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        ref="meterialType"
                        :readonly="readonly"  
                        :float-label="$t('物料分类')"
                        v-model="baseInfoForm.col29"></q-input>
                    </q-field>
                  </div>
                </q-tab-pane>
                <!-- <q-tab-pane name="qualifications">
                  <div class="row gutter-x-sm gutter-y-sm q-mt-sm">
                    <q-field 
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('组织机构代码证编码')"
                        v-model="qualificationsForm.graf1"></q-input>
                    </q-field>
                    <q-field 
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('营业执照编码')"
                        v-model="qualificationsForm.graf2"></q-input>
                    </q-field>
                    <q-field 
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-input
                        :readonly="readonly"  
                        :float-label="$t('税务登记证编码')"
                        v-model="qualificationsForm.graf3"></q-input>
                    </q-field>
                    <q-field 
                      class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                      <q-uploader 
                        color="secondary" 
                        name="files"
                        @uploaded="uploaded"
                        :headers="{'Accept': 'application/json;charset=utf-8'}"
                        stack-label="资质上传" 
                        url="uploadUrl" ></q-uploader>
                    </q-field>
                  </div>
                </q-tab-pane> -->
              </q-tabs>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
              <q-tabs 
                align="left"
                v-model="questionTab" 
                :two-lines="false"
                inverted
                no-pane-border
                color="primary">
                <q-tab slot="title" name="question" label="调查表" ></q-tab>

                <q-tab-pane name="question">
                  <div class="q-mb-sm">
                    <q-btn 
                      color="primary" 
                      @click="questionChange" 
                      size="sm">发起变更</q-btn>
                  </div>
                  <q-list v-if="questionList.length > 0">
                    <q-collapsible 
                      v-for="item in questionList"
                      :key="item.id"
                      opened 
                      group="somegroup" 
                      icon="format_list_bulleted" 
                      :label="item.name">
                      <div class="row justify-start gutter-x-sm gutter-y-xs">
                        <div 
                          style="width: 80px; height:100px; text-align: center" 
                          v-for="question in item.csdata"
                          :key="question.id"
                          @click="openQuestionModal(question.id, question.name)"
                          class="relative-position cursor-pointer">
                          <q-icon 
                            name="description" 
                            color="primary" 
                            size="50px"></q-icon>
                          <q-icon 
                            class="absolute"
                            style="right:0 ; top: 2px"
                            :name="question.taskStatus == '-1'? 'fiber_manual_record':question.taskStatus == '0'? 'border_color':question.taskStatus == '1'? 'done': 'backspace'" 
                            :color="question.taskStatus == '-1'? 'light':question.taskStatus == '0'? 'info':question.taskStatus == '1'? 'positive': 'negative'"
                            size="18px">
                            <q-tooltip v-if="question.taskStatus == '2'">驳回理由：{{ question.approvalContent }}</q-tooltip>
                          </q-icon>
                          <p style="font-size: 12px; color:#bdbdbd">{{ question.name }}</p>
                        </div>
                      </div>
                    </q-collapsible>
                  </q-list>
                  <q-list v-else class="q-pl-md">暂无调查表</q-list>
                </q-tab-pane>
              </q-tabs>
            </div>
          </div>
        </q-card-main>
      </q-card>
      <q-modal no-backdrop-dismiss v-model="questionsModal" :content-css="{minWidth: '100vw', minHeight: '100%',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ questionCurrentClick }}
            </q-toolbar-title>
            <q-btn flat @click="questionsModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <iframe v-if="questionsModal" :src="whichQuestion" frameborder="0" style="width: 100%;height: 98%"></iframe>
        </q-modal-layout>
      </q-modal>
      <q-modal no-backdrop-dismiss v-model="reviewModal" :content-css="{minWidth: '50vw', minHeight: '60%',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ $t("审核") }}
            </q-toolbar-title>
            <q-btn flat @click="reviewModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <q-card class="q-px-md q-py-sm bg-white no-shadow full-width">
            <q-card-main class="row gutter-x-md gutter-y-sm">
              <q-field class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <q-radio v-model="reviewForm.type" val="1" label="通过"></q-radio>
                <q-radio v-model="reviewForm.type" val="2" label="驳回"></q-radio>
              </q-field>
              <q-field 
                :error="$v.reviewForm.approvalContent.$error"
                error-label="该字段为必填项"
                class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                <q-input
                  :float-label="$t('原因')"
                  type="textarea"
                  :max-height="100"
                  rows="4"
                  @blur="$v.reviewForm.approvalContent.$touch"
                  v-model="reviewForm.approvalContent"></q-input>
              </q-field>
            </q-card-main>
          </q-card>
          <q-toolbar slot="footer" color="white" class="row justify-end">
            <q-btn
              flat
              color="primary"
              @click="reviewModal = false">{{$t("取消")}}</q-btn>
            <q-btn
              flat
              :loading="btnLoading"
              color="primary"
              @click="reviewConfirm">{{$t("确认")}}</q-btn>
          </q-toolbar>
        </q-modal-layout>
      </q-modal>
      <!-- 晋级 2 -->
      <q-modal no-backdrop-dismiss v-model="supplierPromoteTwoModal" :content-css="{minWidth: '90vw', minHeight: '90%',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ $t("晋级") }}
            </q-toolbar-title>
            <q-btn flat @click="supplierPromoteTwoModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <q-card class="q-px-md q-py-sm bg-white no-shadow full-width">
            <p class="q-mb-none bdl-secondary-3 q-py-xs q-px-sm">生成编码</p>
            <q-card-main class="row gutter-x-md gutter-y-sm">
              <q-field 
                :error="$v.requestSupplierCodeForm.subjectGroup.$error"
                error-label="科目组为必选项"
                class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                <q-select
                  :options="subjectGroupOptions"
                  :float-label="$t('科目组')"
                  @input="getCodeRuleData"
                  @blur="$v.requestSupplierCodeForm.subjectGroup.$touch"
                  v-model="requestSupplierCodeForm.subjectGroup"></q-select>
              </q-field>
              <q-field 
                :error="$v.requestSupplierCodeForm.codeRule.$error"
                error-label="编码生成规则为必选项"
                class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                <q-select
                  :options="codeRuleOptions" 
                  :float-label="$t('编码生成规则')"
                  @blur="$v.requestSupplierCodeForm.codeRule.$touch"
                  v-model="requestSupplierCodeForm.codeRule"></q-select>
              </q-field>
              <q-field 
                :error="$v.requestSupplierCodeForm.submitStatus.$error"
                error-label="编码生成规则为必选项"
                class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                <q-select
                  :options="isDispatchOptions" 
                  :float-label="$t('是否下发')"
                  @blur="$v.requestSupplierCodeForm.submitStatus.$touch"
                  v-model="requestSupplierCodeForm.submitStatus"></q-select>
              </q-field>
            </q-card-main>
            <p class="q-mb-none bdl-secondary-3 q-py-xs q-px-sm row justify-between">
              <span>添加采购组织</span>
              <q-btn color="secondary" flat size="sm" @click="addPurchaseOrg">继续添加</q-btn>
            </p>
            <q-card-main>
              <div class="row gutter-x-md gutter-y-xs" v-for="(item, index) in $v.purchaseOrgArr.$each.$iter" :key="index">
                <q-field 
                  :error="item.buyerId.$error"
                  error-label="采购组织为必选项"
                  class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                  <q-select
                    :float-label="$t('采购组织')"
                    :options="purchaseOrgOptions"
                    @blur="item.buyerId.$touch"
                    v-model="item.buyerId.$model"></q-select>
                </q-field>
                <q-field 
                  :error="item.orderCurrencyId.$error"
                  error-label="订单货币为必选项"
                  class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                  <q-select
                    :float-label="$t('订单货币')"
                    filter
                    :options="orderCurrencyOptions"
                    @blur="item.orderCurrencyId.$touch"
                    v-model="item.orderCurrencyId.$model"></q-select>
                </q-field>
                <q-field 
                  :error="item.purchasePaymentId.$error"
                  error-label="采购付款条件为必选项"
                  class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                  <q-select
                    :float-label="$t('采购付款条件')"
                    :options="purchasePaymentOptions"
                    @blur="item.purchasePaymentId.$touch"
                    v-model="item.purchasePaymentId.$model"></q-select>
                </q-field>
                <!-- <q-field 
                  :error="item.saleSperson.$error"
                  error-label="销售员为必选项"
                  class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                  <q-input
                    :float-label="$t('销售员')"
                    @blur="item.saleSperson.$touch"
                    v-model="item.saleSperson.$model"></q-input>
                </q-field>
                <q-field 
                  :error="item.saleTelephone.$error"
                  error-label="销售员电话为必选项"
                  class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                  <q-input
                    :float-label="$t('销售员电话')"
                    @blur="item.saleTelephone.$touch"
                    v-model="item.saleTelephone.$model"></q-input>
                </q-field> -->
                <q-field 
                  :error="item.controlDate.$error"
                  error-label="定价日期控制为必选项"
                  class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                  <q-select
                    :float-label="$t('定价日期控制')"
                    :options="controlDateOptions"
                    @blur="item.controlDate.$touch"
                    v-model="item.controlDate.$model"></q-select>
                </q-field>
              </div>
            </q-card-main>
          </q-card>
          <q-toolbar slot="footer" color="white" class="row justify-end">
            <q-btn
              flat
              color="primary"
              @click="supplierPromoteTwoModal = false">{{$t("取消")}}</q-btn>
            <q-btn
              flat
              :loading="btnLoading"
              color="primary"
              @click="supplierPromoteTwoConfirm">{{$t("确认")}}</q-btn>
          </q-toolbar>
        </q-modal-layout>
      </q-modal>
      <!-- 晋级 3 -->
      <q-modal no-backdrop-dismiss v-model="supplierPromoteThreeModal" :content-css="{minWidth: '50vw', minHeight: '60%',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ $t("晋级") }}
            </q-toolbar-title>
            <q-btn flat @click="supplierPromoteThreeModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <q-card class="q-px-md q-py-sm bg-white no-shadow full-width">
            <q-card-main class="row gutter-x-md gutter-y-sm">
              <q-field class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <q-radio v-model="supplierPromoteThreeForm.type" val="1" label="通过"></q-radio>
                <q-radio v-model="supplierPromoteThreeForm.type" val="2" label="驳回"></q-radio>
              </q-field>
              <q-field 
                :error="$v.supplierPromoteThreeForm.approvalContent.$error"
                error-label="原因为必填项"
                class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                <q-input
                  :float-label="$t('原因')"
                  type="textarea"
                  :max-height="100"
                  rows="4"
                  @blur="$v.supplierPromoteThreeForm.approvalContent.$touch"
                  v-model="supplierPromoteThreeForm.approvalContent"></q-input>
              </q-field>
            </q-card-main>
          </q-card>
          <q-toolbar slot="footer" color="white" class="row justify-end">
            <q-btn
              flat
              color="primary"
              @click="supplierPromoteThreeModal = false">{{$t("取消")}}</q-btn>
            <q-btn
              flat
              :loading="btnLoading"
              color="primary"
              @click="supplierPromoteThreeConfirm">{{$t("确认")}}</q-btn>
          </q-toolbar>
        </q-modal-layout>
      </q-modal>
      <!-- 降级 3 -->
      <q-modal no-backdrop-dismiss v-model="supplierDegradeThreeModal" :content-css="{minWidth: '50vw', minHeight: '60%',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ $t("降级") }}
            </q-toolbar-title>
            <q-btn flat @click="supplierDegradeThreeModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <q-card class="q-px-md q-py-sm bg-white no-shadow full-width">
            <q-card-main class="row gutter-x-md gutter-y-sm">
              <q-field class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                <q-radio v-model="supplierDegradeThreeForm.type" val="1" label="通过"></q-radio>
                <q-radio v-model="supplierDegradeThreeForm.type" val="2" label="驳回"></q-radio>
              </q-field>
              <q-field 
                :error="$v.supplierDegradeThreeForm.approvalContent.$error"
                error-label="原因为必填项"
                class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
                <q-input
                  :float-label="$t('原因')"
                  type="textarea"
                  :max-height="100"
                  rows="4"
                  @blur="$v.supplierDegradeThreeForm.approvalContent.$touch"
                  v-model="supplierDegradeThreeForm.approvalContent"></q-input>
              </q-field>
            </q-card-main>
          </q-card>
          <q-toolbar slot="footer" color="white" class="row justify-end">
            <q-btn
              flat
              color="primary"
              @click="supplierDegradeThreeModal = false">{{$t("取消")}}</q-btn>
            <q-btn
              flat
              :loading="btnLoading"
              color="primary"
              @click="supplierDegradeThreeConfirm">{{$t("确认")}}</q-btn>
          </q-toolbar>
        </q-modal-layout>
      </q-modal>
      <!-- 变更 -->
      <q-modal no-backdrop-dismiss v-model="questionChangeModal" :content-css="{minWidth: '50vw', minHeight: '60%',borderRadius: '4px'}">
        <q-modal-layout>
          <q-toolbar slot="header" color="white">
            <q-toolbar-title class="text-dark">
              {{ $t("变更") }}
            </q-toolbar-title>
            <q-btn flat @click="questionChangeModal = false">
              <q-icon name="close" color="dark"></q-icon>
            </q-btn>
          </q-toolbar>
          <q-card class="q-px-md q-py-sm bg-white no-shadow full-width">
            <q-card-main class="row justify-center">
              <q-field 
                :error="$v.questionChangeForm.questionIds.$error"
                error-label="调查表为必选项"
                class="col-lg-10 col-md-10 col-sm-12 col-xs-12">
                <q-select
                  multiple
                  :float-label="$t('调查表')"
                  :options="questionAllOptions"
                  @blur="$v.questionChangeForm.questionIds.$touch"
                  v-model="questionChangeForm.questionIds"></q-select>
              </q-field>
            </q-card-main>
          </q-card>
          <q-toolbar slot="footer" color="white" class="row justify-end">
            <q-btn
              flat
              color="primary"
              @click="questionChangeModal = false">{{$t("取消")}}</q-btn>
            <q-btn
              flat
              :loading="btnLoading"
              color="primary"
              @click="questionChangeConfirm">{{$t("确认")}}</q-btn>
          </q-toolbar>
        </q-modal-layout>
      </q-modal>
    </div>
    
    <!-- ie-polyfill 、 vue.js and quasar-framework -->
    <script src="../lib/js/quasar.ie.polyfills.umd.min.js"></script>
    <script src="../lib/js/vue.js"></script>
    <script src="../lib/js/quasar.mat.umd.min.js"></script>
    <!-- babel for es6 transform -->
    <!-- <script src="lib/js/babel.min.js"></script> -->
    <!-- vue validate -->
    <script src="../lib/js/vuelidate.min.js"></script>
    <script src="../lib/js/validators.min.js"></script>
    <!-- consts ps: always leave this file first -->
    <script src="../script/utils.js"></script>
    <script src="../script/consts.js"></script>
    <!-- status code -->
    <script src="../script/status.code.js"></script>
    <!-- qs for axios -->
    <script src="../lib/js/qs.min.js"></script>
    <!-- axios for http request -->
    <script src="../lib/js/axios.js"></script>
    <!-- axios.instance must be after axios -->
    <script src="../script/axios.instance.js"></script>
    <!-- quasar i18n zh-hans -->
    <script src="../lib/lang/zh-hans.js"></script>
    <!-- vue-i18n for application's internationalization -->
    <script src="../lib/js/vue-i18n.js"></script>
    <!-- current page international file -->
    <script src="../lang/sop/supplierBaseInfoLook.js"></script>
    <script>
      // quasar components use
      Quasar.i18n.set(Quasar.i18n[LANGUGE])

      Vue.use(window.vuelidate.default)
      var minLength = window.validators.minLength
      var required = window.validators.required
      var email = window.validators.email

      Vue.prototype.window = window
      var supplierInvite = new Vue({
        el: '#q-supplierBaseInfoLook',
        i18n: i18n,
        data: function() {
          return {
            mainReviewable: false,  // 是否有权审核 主信息
            baseReviewable: false,  // 是否有权审核 基本信息
            promotable: false,  // 是否有权晋级 1
            promotable2: false,  // 是否有权晋级 2
            promotable3: false,  // 是否有权晋级 3
            degradable: false,  // 是否有权降级 1
            degradable2: false,  // 是否有权降级 2
            degradable3: false,  // 是否有权降级 3
            id: '',
            orgId: '',
            reviewUrl: '',
            // 基本信息
            choosedTab: 'baseInfo', // 默认选中的tab
            mainTab: 'mainInfo',
            questionTab: 'question',
            currentSupplierId: '',  // 当前供应商ID
            editOrSvae: 'edit',
            readonly: true,
            isEdit: false,
            isSubmit: false,
            baseInfoForm: {
              // name: '测试供应商 - 1',    // 供应商名称
              legalPerson: '',          // 企业法人
              col22: '',                // 主信息变更 变更文件系统编号
              col23: '',                // 主信息变更 变更内容
              col24: '',                // 法人身份证号
              col26: '',                // 企业英文全称
              duns: '',                 // 邓白氏码
              col25: '',                // 贸易伙伴
              property: '',             // 企业性质
              vendorClassify: '',       // 企业类别
              subjectGroup: '',         // 科目组
              companyId: '',            // 公司代码
              country: '',              // 国家
              province: '',             // 省份
              city: '',                 // 城市
              address: '',              // 街道
              shortName: '',            // 企业简称
              postCode: '',             // 邮编
              phone: '',                // 电话
              mobilePhone: '',          // 手机
              fax: '',                  // 传真
              // email: '',                // 邮箱
              contacts: '',             // 联系人
              postCode: '',             // 邮编
              managerContact: '',       // 总经理联系人
              managerTelephone: '',     // 总经理联系电话
              salesDirector: '',         // 销售总监联系人
              salesDirectorTelephone: '',// 销售总监联系电话
              // taxId: '',                // 税号
              name: '',
              phaseName: '',
              phaseNameShang: '',
              phaseNameXia: '',
              email: '',
              taxId: '',
              lastUpdateTime: '',
              mainDataStatus: '',
              mainDataContent: '',
              code: '',
              basicsDataStatus: '',      // 基本信息状态
              basicsDataContent: '',
              col28: '',  // 所选物料ids
              col29: '',   // 所选物料名称
              submiePhaseIdTime: ''
            },
            downloadName: '',
            downloadUrl: '',
            downloadNamex: '',
            downloadUrlx: '',
            vendorClassifyOptions: [
              {
                label: '有限责任公司',
                value: '1'
              },
              {
                label: '股份制公司',
                value: '2'
              },
              {
                label: '集团公司',
                value: '3'
              },
              {
                label: '一人制公司',
                value: '4'
              }
            ],
            propertyOptions: [
              {
                label: '国有企业',
                value: '1'
              },
              {
                label: '国有控股企业',
                value: '2'
              },
              {
                label: '外资企业',
                value: '3'
              },
              {
                label: '合资企业',
                value: '4'
              },
              {
                label: '私营企业',
                value: '5'
              }
            ],
            countryOptions: [
              {
                label: '中国',
                value: 49
              }
            ],  // 国家数据
            provinceOptions: [],  // 省份数据
            cityOptions: [],  // 城市数据
            subjectGroupOptions: [], // 科目组数据
            companyIdOptions: [], // 公司代码 数据
            btnLoading: false,
            questionsModal: false,
            whichQuestion: '',
            questionCurrentClick: '', // 当前点击的调查表名称
            questionList: [
            ],  // 调查表数据
            // 资质信息
            qualificationsForm: {
              graf1: '',
              graf2: '',
              graf3: ''
            },
            // 审核
            type: '',
            reviewModal: false,
            reviewForm: {
              type: 'allow',
              approvalContent: 'ok'
            },
            // 晋级2 erp
            supplierPromoteTwoModal: false,
            requestSupplierCodeForm: {
              subjectGroup: '',
              codeRule: '',
              submitStatus: '1'
            },
            subjectGroupOptions: [],
            codeRuleOptions: [],
            // 晋级 2 添加采购组织
            isDispatchOptions: [  // 是否下发options
              {
                label: '是',
                value: '1'
              },
              {
                label: '否',
                value: '2'
              }
            ],
            purchaseOrgOptions: [],  // 采购组织数据
            orderCurrencyOptions: [],  // 货币数据
            purchasePaymentOptions: [],  // 付款条件数据
            controlDateOptions: [],  // 定价日期控制数据
            purchaseOrgArr: [
              {
                buyerId: '',
                orderCurrencyId: '', // 货币
                purchasePaymentId: '', // 付款条件
                saleSperson: '', // 销售员
                saleTelephone: '', // 销售电话
                controlDate: ''  // 定价日期控制
              }
            ],
            // 晋级 3
            supplierPromoteThreeModal: false,
            supplierPromoteThreeForm: {
              type: '1',
              approvalContent: 'ok'
            },
            // 降级 3
            supplierDegradeThreeModal: false,
            supplierDegradeThreeForm: {
              type: '1',
              approvalContent: 'ok'
            },
            questionChangeForm: {
              questionIds: []
            },
            questionAllOptions: [],
            questionChangeModal: false
          }
        },
        validations: {
          requestSupplierCodeForm: {
            subjectGroup: { required: required },
            codeRule: { required: required },
            submitStatus: { required: required }
          },
          purchaseOrgArr: {
            $each: {
              buyerId: { required: required },
              orderCurrencyId: { required: required },
              purchasePaymentId: { required: required },
              // saleSperson: { required: required },
              // saleTelephone: { required: required },
              controlDate: { required: required },
            }
          },
          reviewForm: {
            approvalContent: { required: required }
          },
          supplierPromoteThreeForm: {
            approvalContent: { required: required }
          },
          supplierDegradeThreeForm: {
            approvalContent: { required: required }
          },
          questionChangeForm: {
            questionIds: { required: required }
          }
        },
        computed: {
         
        },
        created: function() {
          var TOKEN = GetRequest()
          this.orgId = TOKEN.orgId
          this.id = TOKEN.id
          // this.getCountryData()
          this.getInfo()
          this.getQuestionList()
          this.getSubjectGroupData()
          this.getCodeData()
          this.getBuyerIdData()
          this.getOrderCurrencyData()
          this.getPurchasePaymentData()
          this.getControlDateData()
        },
        watch: {
          'baseInfoForm.country': function(country) {
            this.getProvinceData(country)
          },
          'baseInfoForm.province': function(province) {
            this.getCityData(province)
          },
          'baseInfoForm.col28': function(col28) {
            if (col28 == null || col28 == undefined || col28 == '') {
              this.nodeTicked = []
            } else {
              this.nodeTicked = col28.split(',')
            }
          },
          questionsModal: function(questionsModal) {
            if (questionsModal == false) {
              this.getQuestionList()
            }
          },
          'supplierPromoteThreeForm.type': function(type) {
            if (type == '1') {
              this.supplierPromoteThreeForm.approvalContent = 'ok'
            } else{
              this.supplierPromoteThreeForm.approvalContent = ''
            }
          },
          'supplierDegradeThreeForm.type': function(type) {
            if (type == '1') {
              this.supplierDegradeThreeForm.approvalContent = 'ok'
            } else{
              this.supplierDegradeThreeForm.approvalContent = ''
            }
          },
          'reviewForm.type': function(type) {
            if (type == '1') {
              this.reviewForm.approvalContent = 'ok'
            } else{
              this.reviewForm.approvalContent = ''
            }
          }
        },
        methods: {
          // 首屏数据
          getInfo: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/new/vendor/baseInfoNew/vendorQueryVendorBaseInfo?orgId=' + this.orgId
            })
            .then(function(data) {
              if (data.statusCode == 200) {
                if (data.single.fileUrl != null && data.single.userFileName != null) {
                  var _filename = encodeURI(encodeURIComponent(data.single.fileUrl.split('.')[0]))
                  that.downloadUrl = baseURL + '/common/download/' + _filename + '/' + data.single.fileUrl.split('.')[1]
                  that.downloadName = data.single.userFileName
                } else {
                  that.downloadUrl = 'javascript:;'
                  that.downloadName = '暂无附件'
                }
                if (data.single.fileUrlx != null && data.single.userFileNamex != null) {
                  var _filenamex = encodeURI(encodeURIComponent(data.single.fileUrl.split('.')[0]))
                  that.downloadUrlx = baseURL + '/common/download/' + _filenamex + '/' + data.single.fileUrlx.split('.')[1]
                  that.downloadNamex = data.single.col22
                } else {
                  that.downloadUrlx = 'javascript:;'
                  that.downloadNamex = '暂无附件'
                }
                that.baseInfoForm = {
                  legalPerson: data.single.legalPerson,          // 企业法人
                  col22: data.single.col22,                // 
                  col23: data.single.col23,                //
                  col24: data.single.col24,                // 法人身份证号
                  col26: data.single.col26,                // 企业英文全称
                  duns: data.single.duns,                 // 邓白氏码
                  col25: data.single.col25,                // 贸易伙伴
                  property: data.single.property,             // 企业性质
                  vendorClassify: data.single.vendorClassify,       // 企业类别
                  companyId: data.single.companyId,            // 公司代码
                  country: data.single.country,              // 国家
                  province: data.single.province,             // 省份
                  city: data.single.city,                 // 城市
                  address: data.single.address,              // 街道
                  shortName: data.single.shortName,      // 企业简称
                  postCode: data.single.postCode,             // 邮编
                  phone: data.single.phone,                // 电话
                  mobilePhone: data.single.mobilePhone,          // 手机
                  fax: data.single.fax,                  // 传真
                  contacts: data.single.contacts,             // 联系人
                  postCode: data.single.postCode,             // 邮编
                  managerContact: data.single.managerContact,       // 总经理联系人
                  managerTelephone: data.single.managerTelephone,     // 总经理联系电话
                  salesDirector: data.single.salesDirector,         // 销售总监联系人
                  salesDirectorTelephone: data.single.salesDirectorTelephone,// 销售总监联系电话
                  name: data.single.name,
                  phaseName: data.single.phaseName,
                  phaseNameShang: data.single.phaseNameShang,
                  phaseNameXia: data.single.phaseNameXia,
                  email: data.single.email,
                  taxId: data.single.taxId,
                  lastUpdateTime: data.single.lastUpdateTime,
                  mainDataStatus: data.single.mainDataStatus,
                  mainDataContent: data.single.mainDataContent,
                  code: data.single.code,
                  basicsDataStatus: data.single.basicsDataStatus,
                  basicsDataContent: data.single.basicsDataContent,
                  col28: data.single.col28,
                  col29: data.single.col29,  // 物料分类
                  usefulTime: data.single.usefulTime,
                  submiePhaseIdTime: data.single.submiePhaseIdTime
                }
                that.mainReviewable = data.single.mainReviewable
                that.baseReviewable = data.single.baseReviewable
                that.promotable = data.single.promotable // 晋级 1
                that.promotable2 = data.single.promotable2 // 晋级 2
                that.promotable3 = data.single.promotable3 // 晋级 3
                that.degradable = data.single.degradable  // 降级 1 2 3
                that.degradable2 = data.single.degradable2
                that.degradable3 = data.single.degradable3
              } else {
                that.$q.notify({
                  message: that.$t(STATUS_CODE[data.statusCode]),
                  icon: 'error_outline',
                  type: 'negative',
                  position: 'top-right'
                })
              }
            })
            .catch(function(err) {
              console.log(err)
            })
          },
          // 调查表
          getQuestionList: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/new/vendor/baseInfoNew/vendorQueryQuestionnaire?orgId=' + this.orgId
            })
            .then(function(data) {
              if (data.statusCode == 200) {
                that.questionList = data.rows
              } else {
                that.$q.notify({
                  message: that.$t(STATUS_CODE[data.statusCode]),
                  icon: 'error_outline',
                  type: 'negative',
                  position: 'top-right'
                })
              }
            })
            .catch(function(err) {
              console.log(err)
            })
          },
          openQuestionModal: function(id, name) {
            // var that = this
            // axios({
            //   method: 'post',
            //   url: '/manager/new/vendor/baseInfoNew/produceForm',
            //   data: {
            //     id: id
            //   }
            // })
            // .then(function(data) {
            //   if (data.statusCode == 200) {
                this.questionCurrentClick = name
                this.whichQuestion = './lookRegisterBaseInfo.html?id=' + id +'&orgId=' + this.orgId
                this.questionsModal = true
                
            //   } else {
            //     that.$q.notify({
            //       message: that.$t(STATUS_CODE[data.statusCode]),
            //       icon: 'error_outline',
            //       type: 'negative',
            //       position: 'top-right'
            //     })
            //   }
            // })
            // .catch(function(err) {
            //   console.log(err, '获取调查表详情时捕获异常')
            // })
          },
          // 获取国家数据
          // getCountryData: function() {
          //   var that = this
          //   axios({
          //     method: 'post',
          //     url: '/manager/basedata/area/getAreaByLevel/1'
          //   })
          //   .then(function(data) {
          //     var _arr = []
          //     data.map(function(item) {
          //       var _obj = {}
          //       _obj.label = item.name
          //       _obj.value = item.id
          //       _arr.push(_obj)
          //     })
          //     that.countryOptions = _arr
          //   })
          //   .catch(function(err) {
          //     console.log(err, '获取国家数据时捕获异常')
          //   })
          // },
          // 获取省份数据
          getProvinceData: function(country) {
            var that = this
            axios({
              method: 'post',
              url: 'manager/basedata/area/getAreaByParentId/' + country
            })
            .then(function(data) {
                var _arr = []
                if (data.length > 0) {
                  data.map(function(item) {
                    var _obj = {}
                    _obj.label = item.name
                    _obj.value = item.id
                    _arr.push(_obj)
                  })
                  that.provinceOptions = _arr
                } else {
                  // _arr.push({
                  //   label: '无',
                  //   value: 'none'
                  // })
                  // that.provinceOptions = _arr
                }
            })
            .catch(function(err) {
              console.log(err, '获取省份数据时捕获异常')
            })
          },
          // 获取城市数据
          getCityData: function(province) {
            var that = this
            axios({
              method: 'post',
              url: '/manager/basedata/area/getAreaByParentId/' + province
            })
            .then(function(data) {
              var _arr = []
              if (data.length > 0) {
                data.map(function(item) {
                  var _obj = {}
                  _obj.label = item.name
                  _obj.value = item.id
                  _arr.push(_obj)
                })
                that.cityOptions = _arr
              } else {
                // _arr.push({
                //   label: '无',
                //   value: 'none'
                // })
                // that.cityOptions = _arr
              }
            })
            .catch(function(err) {
              console.log(err, '获取城市数据时捕获异常')
            })
          },
          // 获取科目组数据
          getSubjectGroupData: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/basedata/dictGroup/getDictItemSelect/SUBJECT'
            })
            .then(function(data) {
                var _arr = []
                data.map(function(item) {
                  var _obj = {}
                  _obj.label = item.name
                  _obj.value = item.id
                  _arr.push(_obj)
                })
                that.subjectGroupOptions = _arr
            })
            .catch(function(err) {
              console.log(err, '获取科目组数据时捕获异常')
            })
          },
          // 根据科目组 获取 编码规则
          getCodeRuleData: function(subject) {
            var that = this
            axios({
              method: 'post',
              url: '/manager/basedata/dictGroup/getSubjectCodeRuleRel/' + subject
            })
            .then(function(data) {
                var _arr = []
                data.map(function(item) {
                  var _obj = {}
                  _obj.label = item.name
                  _obj.value = item.name
                  _arr.push(_obj)
                })
                that.codeRuleOptions = _arr
            })
            .catch(function(err) {
              console.log(err, '获取科目组数据时捕获异常')
            })
          },
          // 获取公司代码数据
          getCodeData: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/basedata/company/getCompany'
            })
            .then(function(data) {
              var _arr = []
              data.map(function(item) {
                var _obj = {}
                _obj.label = item.name
                _obj.value = item.id + ''
                _arr.push(_obj)
              })
              that.companyIdOptions = _arr
            })
            .catch(function(err) {
              console.log(err, '获取公司代码数据时捕获异常')
            })
          },
          reviewHandler: function(where) {
            this.reviewForm = {
              type: 'allow',
              approvalContent: 'ok'
            }
            this.reviewModal = true
            if (where == 'top') {
              this.reviewUrl = '/manager/new/vendor/baseInfoNew/approvalVendorBaseInfoMain'
            }
            if (where == 'base') {
              this.reviewUrl = '/manager/new/vendor/baseInfoNew/approvalVendorBaseInfoBasics'
            }
          },
          reviewConfirm: function() {
            this.$v.reviewForm.$touch()
            if (!this.$v.reviewForm.$error) {
              var that = this
              axios({
                method: 'post',
                url: this.reviewUrl,
                data: {
                  orgId: this.orgId,
                  type: this.reviewForm.type,
                  approvalContent: this.reviewForm.approvalContent
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '审批成功',
                    icon: 'done',
                    type: 'positive',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.reviewModal = false
                that.getInfo()
              })
              .catch(function(err) {
                console.log(err, '审核时捕获到异常')
              })
            }
          },
          // 晋级 1
          supplierPromoteOne: function() {
            var that = this
            this.$q.dialog({
              title: '晋级',
              message: '确认晋级当前供应商吗？',
              ok: {
                label: '确认',
                flat: true,
                color: 'primary'
              },
              cancel: {
                label: '取消',
                flat: true,
                color: 'primary'
              }
            })
            .then(function() {
              axios({
                method: 'post',
                url: '/manager/new/vendor/baseInfoNew/upddateVendorBaseInfoPromotable1', // TODO: 暂无接口
                data: {
                  id: that.id
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.getInfo()
                that.getQuestionList()
              })
              .catch(function(err) {
                console.log(err, '方式1晋级时捕获异常！')
              })
            })
            .catch(function() {
            })
          },
          // 晋级 2
          supplierPromoteTwo: function() {
            this.purchaseOrgArr = [
              {
                buyerId: '',
                orderCurrencyId: '', // 货币
                purchasePaymentId: '', // 付款条件
                saleSperson: this.baseInfoForm.salesDirector, // 销售员
                saleTelephone: this.baseInfoForm.salesDirectorTelephone, // 销售电话
                controlDate: ''  // 定价日期控制
              }
            ]
            this.requestSupplierCodeForm = {
              subjectGroup: '',
              codeRule: '',
              submitStatus: '1'
            }
            this.$v.purchaseOrgArr.$each.$reset()
            this.$v.requestSupplierCodeForm.$reset()
            this.supplierPromoteTwoModal = true
          },
          // 获取采购组织数据
          getBuyerIdData: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/admin/organization/getPurGroupList',
            })
            .then(function(data) {
              var _arr = []
              data.map(function(item) {
                var _obj = {}
                _obj.label = item.name
                _obj.value = item.id
                _arr.push(_obj)
              })
              that.purchaseOrgOptions = _arr
            })
            .catch(function(err) {

            })
          },
          // 获取订单货币数据
          getOrderCurrencyData: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/basedata/frameAgreement/getCurrencyList',
            })
            .then(function(data) {
              var _arr = []
              data.map(function(item) {
                var _obj = {}
                _obj.label = item.currencyName
                _obj.value = item.id
                _arr.push(_obj)
              })
              that.orderCurrencyOptions = _arr
            })
            .catch(function(err) {

            })
          },
          // 获取采购付款条件数据
          getPurchasePaymentData: function() {
            var that = this
            axios({
              method: 'post',
              url: 'manager/basedata/dictGroup/getDictItemSelect/PURCHASEPAYMENT',
            })
            .then(function(data) {
              var _arr = []
              data.map(function(item) {
                var _obj = {}
                _obj.label = item.name
                _obj.value = item.id
                _arr.push(_obj)
              })
              that.purchasePaymentOptions = _arr
            })
            .catch(function(err) {

            })
          },
          // 获取定价日期控制数据
          getControlDateData: function() {
            var that = this
            axios({
              method: 'post',
              url: '/manager/basedata/dictGroup/getDictItemSelect/CONTROLDATE',
            })
            .then(function(data) {
              var _arr = []
              data.map(function(item) {
                var _obj = {}
                _obj.label = item.name
                _obj.value = item.code
                _arr.push(_obj)
              })
              that.controlDateOptions = _arr
            })
            .catch(function(err) {

            })
          },
          addPurchaseOrg: function() {
            this.purchaseOrgArr.push({
              buyerId: '',
              orderCurrencyId: '', // 货币
              purchasePaymentId: '', // 付款条件
              saleSperson: this.baseInfoForm.salesDirector, // 销售员
              saleTelephone: this.baseInfoForm.salesDirectorTelephone, // 销售电话
              controlDate: ''  // 定价日期控制
            })
          },
          supplierPromoteTwoConfirm: function() {
            this.$v.purchaseOrgArr.$each.$touch()
            this.$v.requestSupplierCodeForm.$touch()
            if (!this.$v.purchaseOrgArr.$each.$error && !this.$v.requestSupplierCodeForm.$error) {
              var that = this
              this.btnLoading = true 
              axios({
                method: 'post',
                url: '/manager/new/vendor/baseInfoNew/upddateVendorBaseInfoPromotable2',
                headers: { 'Content-Type': 'application/json;charset=UTF-8'},
                data: {
                  params: {
                    vendorId: this.id,
                    subjectGroup: this.requestSupplierCodeForm.subjectGroup,
                    codeRule: this.requestSupplierCodeForm.codeRule,
                    submitStatus: this.requestSupplierCodeForm.submitStatus,
                    rowsPurchase: this.purchaseOrgArr
                  }
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.btnLoading = false 
                that.supplierPromoteTwoModal = false
                that.getInfo()
                that.getQuestionList()
              })
              .catch(function(err) {
                console.log(err, '方式2晋级时捕获到异常')
              })
            }
          },
          // 晋级 3
          supplierPromoteThree: function() {
            this.supplierPromoteThreeForm = {
              type: '1',
              approvalContent: 'ok'
            }
            this.$v.supplierPromoteThreeForm.$reset()
            this.supplierPromoteThreeModal = true
          },
          supplierPromoteThreeConfirm: function() {
            this.$v.supplierPromoteThreeForm.$touch()
            if (!this.$v.supplierPromoteThreeForm.$error) {
              var that = this
              this.btnLoading = true
              axios({
                method: 'post',
                url: '/manager/new/vendor/baseInfoNew/approvalVendorBaseInfoPromotable',
                data: {
                  orgId: this.orgId,
                  type: this.supplierPromoteThreeForm.type,
                  approvalContent: this.supplierPromoteThreeForm.approvalContent
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.btnLoading = false 
                that.supplierPromoteThreeModal = false
                that.getInfo()
                that.getQuestionList()
              })
              .catch(function(err) {
                console.log(err, '方式3晋级时捕获到异常')
              })
            }
          },
          // 降级
          supplierDegradeOne: function() {
            var that = this
            this.$q.dialog({
              title: '降级',
              message: '确认降级当前供应商吗？',
              ok: {
                label: '确认',
                flat: true,
                color: 'primary'
              },
              cancel: {
                label: '取消',
                flat: true,
                color: 'primary'
              }
            })
            .then(function() {
              axios({
                method: 'post',
                url: '/manager/new/vendor/baseInfoNew/upddateVendorBaseInfoDegradable', // TODO: 暂无接口
                data: {
                  id: that.id
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.getInfo()
                that.getQuestionList()
              })
              .catch(function(err) {
                console.log(err, '方式1晋级时捕获异常！')
              })
            })
            .catch(function() {
            })
          },
          // 降级 2
          supplierDegradeTwo: function() {

          },
          // 降级 3
          supplierDegradeThree: function() {
            this.supplierDegradeThreeForm = {
              type: '1',
              approvalContent: 'ok'
            }
            this.$v.supplierDegradeThreeForm.$reset()
            this.supplierDegradeThreeModal = true
          },
          supplierDegradeThreeConfirm: function() {
            this.$v.supplierDegradeThreeForm.$touch()
            if (!this.$v.supplierDegradeThreeForm.$error) {
              var that = this
              this.btnLoading = true
              axios({
                method: 'post',
                url: '/manager/new/vendor/baseInfoNew/approvalVendorBaseInfoDegradable',
                data: {
                  orgId: this.orgId,
                  type: this.supplierDegradeThreeForm.type,
                  approvalContent: this.supplierDegradeThreeForm.approvalContent
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.btnLoading = false 
                that.supplierDegradeThreeModal = false
                that.getInfo()
                that.getQuestionList()
              })
              .catch(function(err) {
                console.log(err, '方式3晋级时捕获到异常')
              })
            }
          },
          questionChange: function() {
            this.questionAllOptions = []
            var that = this
            this.questionList.map(function(item) {
              item.csdata.map(function(question) {
                if (question.taskStatus == 1) {
                  var _obj = {}
                  _obj.label = question.name
                  _obj.value = question.id
                  that.questionAllOptions.push(_obj)
                }
              })
            })
            this.questionChangeModal = true
          },
          questionChangeConfirm: function() {
            var that = this
            this.$v.questionChangeForm.$touch()
            if (!this.$v.questionChangeForm.$error) {
              this.btnLoading = true
              axios({
                method: 'post',
                url: '/manager/new/vendor/baseInfoNew/initiatingAChange', // TODO:
                data: {
                  ids: this.questionChangeForm.questionIds.join(','),
                  orgId: this.orgId
                }
              })
              .then(function(data) {
                if (data.statusCode == 200) {
                  that.$q.notify({
                    message: '操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else if (data.statusCode == 201) {
                  that.$q.notify({
                    message: '部分操作成功',
                    type: 'positive',
                    icon: 'done',
                    position: 'top-right'
                  })
                } else {
                  that.$q.notify({
                    message: that.$t(STATUS_CODE[data.statusCode]),
                    icon: 'error_outline',
                    type: 'negative',
                    position: 'top-right'
                  })
                }
                that.btnLoading = false
                that.questionChangeModal = false
                that.getQuestionList()
              })
              .catch(function(err) {
                console.log(err)
              })
            }
          }
        }
      })
    </script>
  </body>
</html>